﻿using Sprout.Core.Paging;
using Sprout.Repository;
using Sprout.Schedule.Dtos;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Sprout.Schedule.Daos
{
    [Repository(DataSource = "Schedule")]
    public interface ITaskLogDao : IRepository
    {
        /// <summary>
        /// 新增日志
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [Execute(StatementId = "Insert")]
        Task InsertAsync(TaskLog dto);

        /// <summary>
        /// 新增日志
        /// </summary>
        /// <param name="logs"></param>
        /// <returns></returns>
        [Execute(StatementId = "Insert")]
        Task InsertAsync(IList<TaskLog> logs);

        /// <summary>
        /// 分页查询日志记录
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [Select(StatementId = "Gets")]
        Task<PagedList<TaskLog>> GetPagingAsync(TaskLogQuery query);

        /// <summary>
        /// 删除日志
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [Execute(StatementId = "Delete")]
        Task<int> DeleteAsync(TaskLog dto);
    }
}
